<?php $this->start('admin_menu')?>
	<?php echo $this->element('admin_menu', array('str_item' => 'products')) ?>
<?php $this->end(); ?>

<div class="properties form">
<?php echo $this->Form->create('Property'); ?>
	<?php echo $this->Form->input('id'); ?>
	<h2><?php echo __('Properties Management - Edit Property'); ?></h2>
	<?php 
		echo $this->Session->flash(); 
		echo $this->Session->flash('good');
		echo $this->Session->flash('bad');
	?>
	<table class="form-table">
		<tr>
			<td class='l-style'><?php echo __('Name') ?><span class='star-rq'> * </span></td>
			<td class="r-style width_middle"><?php echo $this->Form->input('name', array('label' => false)); ?></td>
		</tr>
		<tr>
			<td class='l-style'><?php echo __('Example') ?></td>
			<td class="r-style width_middle"><?php echo  $this->Form->input('example', array('label' => false)); ?></td>
		</tr>
		<tr>
			<td class='l-style'><?php echo __('Constraint') ?></td>
			<td class="r-style width_middle">
				<div class="width_middle_child">
				<?php
					$tmpConstraints = explode(";",$this->request->data['Property']['constraint']);
				?>
				<?php foreach($constraints as $key => $parameter){ ?>
					<label class="constraint-lb">
						<input type="checkbox" value="<?php echo $parameter['Parameter']['value'] ?>" 
										id="property_constraint_<?php echo $parameter['Parameter']['value']?>" 
										name="data[Property][constraint][]" <?php echo in_array($parameter['Parameter']['value'], $tmpConstraints) ? "checked" : "" ?> />
						<?php echo $parameter['Parameter']['description'] ?>
					</label>
				<?php } ?>
				</div>
			</td>
		</tr>
		<tr>
			<td class='l-style no-border no-background'>
				(<span class='red-star'>*</span>) <?php echo __('Required') ?>
			</td>
			<td class='r-style actions no-border no-background'><?php echo $this->Form->end(__('Submit')); ?></td>
		</tr>
	</table>
</div>
<div class='actionct'>
	<span class='btn-act'><span><?php echo  $this->Html->link(__('Back'), array('action' => 'index'), array('class' => 'back-act')); ?></span></span>
	<span class='btn-act'><span><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Property.id')), array('class' => 'del-link'), __('Are you sure you want to delete # %s?', $this->Form->value('Property.id'))); ?></span></span>
</div>


